package com.example.service.impl;


import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.example.config.R;
import com.example.domain.Address;
import com.example.mapper.AddressMapper;
import com.example.service.IAddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 收货地址Service业务层处理
 *
 * @author ruoyi
 * @date 2022-11-22
 */
@Service
public class AddressServiceImpl implements IAddressService {

    @Autowired
    private AddressMapper addressMapper;

    @Override
    public R getAddress(Long memberId) {
        LambdaQueryWrapper<Address> lqw = new LambdaQueryWrapper<>();
        lqw.eq(Address::getMemberId, memberId);
        List<Address> addressList = addressMapper.selectList(lqw);
        return R.ok(addressList);
    }
}
